<?php TPL::output('global/header.tpl.htm'); ?>

<div class="aw-container-wrap">
    <div class="container">
        <div class="row">
            <div class="aw-content-wrap clearfix">
                <div class="col-sm-12 col-md-9 aw-main-content">
                    <!-- tab切换 -->
                    <ul class="nav nav-tabs aw-nav-tabs active hidden-xs">
                        <?php if (!$_GET['topic_id']) { ?>
                        <li <?php if ($_GET['day'] == 'month') { ?>class="active"<?php } ?>><a href="topic/channel-hot__day-month"><?php _e('%s 天', 30); ?></a></li>
                        <li <?php if ($_GET['day'] == 'week') { ?>class="active"<?php } ?>><a href="topic/channel-hot__day-week"><?php _e('%s 天', 7); ?></a></li>
                        <li <?php if (!$_GET['day']) { ?>class="active"<?php } ?>><a href="topic/"><?php _e('全部'); ?></a></li>
                        <?php } ?>
                        <?php if ($_GET['channel'] == 'focus') { ?>
                        <h2 class="hidden-xs"><i class="icon icon-topic"></i> <?php _e('我关注的话题'); ?></h2>
                        <?php } else { ?>
                        <h2 class="hidden-xs"><i class="icon icon-topic"></i> <?php _e('热门话题'); ?></h2>
                        <?php } ?>
                    </ul>
                    <!-- end tab切换 -->

                    <!-- 话题分类 -->
                    <?php if ($this->parent_topics) { ?>
                    <div class="aw-mod aw-topic-category">
                        <div class="mod-body clearfix">
                            <ul>
                                <li>
                                    <a <?php if (!$_GET['topic_id']) { ?>class="active"<?php } ?> href="topic/"><?php _e('全部话题'); ?></a>
                                </li>
                                <?php foreach ($this->parent_topics AS $key => $val) { ?>
                                <li>
                                    <a href="topic/channel-topic__topic_id-<?php echo $val['topic_id']; ?>"<?php if ($_GET['topic_id'] == $val['topic_id']) { ?> class="active"<?php } ?>><?php echo $val['topic_title']; ?></a>
                                </li>
                                <?php } ?>
                            </ul>
                        </div>
                    </div>
                    <?php } ?>
                    <!-- end 话题分类 -->

                    <!-- 我关注的话题 -->
                    <div class="aw-mod aw-topic-list">
                        <div class="mod-body clearfix">
                            <?php if ($this->topics_list) { ?>
                            <?php foreach ($this->topics_list AS $key => $val) { ?>
                            <div class="aw-item">
                                <!-- 话题图片 -->
                                <a class="img aw-border-radius-5" href="topic/<?php echo $val['url_token']; ?>" data-id="<?php echo $val['topic_id']; ?>">
                                    <img src="<?php echo get_topic_pic_url('mid', $val['topic_pic']); ?>" alt="" />
                                </a>
                                <!-- end 话题图片 -->
                                <p class="clearfix">
                                    <!-- 话题内容 -->
                                    <span class="topic-tag">
                                        <a class="text" href="topic/<?php echo $val['url_token']; ?>" data-id="<?php echo $val['topic_id']; ?>"><?php echo $val['topic_title']; ?></a>
                                    </span>
                                    <!-- end 话题内容 -->
                                </p>
                                <p class="text-color-999">
                                    <span><?php _e('%s 个讨论', $val['discuss_count']); ?></span>
                                    <span><?php _e('%s 个关注', $val['focus_count']); ?></span>
                                </p>
                                <p class="text-color-999">
                                    <?php _e('7 天新增 %s 个讨论', $val['discuss_count_last_week']); ?>, <?php _e('30 天新增 %s 个讨论', $val['discuss_count_last_month']); ?>
                                </p>
                            </div>
                            <?php } ?>
                            <?php } ?>
                        </div>
                        <div class="mod-footer clearfix">
                            <?php echo $this->pagination; ?>
                        </div>
                    </div>
                    <!-- end 我关注的话题 -->
                </div>
                <!-- 侧边栏 -->
                <div class="col-sm-3 col-md-3 aw-side-bar hidden-sm hidden-xs">
                    <!-- 今日话题 -->
                    <div class="aw-mod topic-daily hidden-xs">
                        <div class="mod-head">
                            <h3><?php _e('今日话题'); ?></h3>
                        </div>
                        <div class="mod-body">
                            <dl>
                                <dt class="pull-left">
                                    <!-- 话题图片 -->
                                    <a data-id="<?php echo $this->today_topic['topic_id']; ?>" class="img aw-border-radius-5" href="topic/<?php echo $this->today_topic['url_token']; ?>">
                                        <img src="<?php echo get_topic_pic_url('mid', $this->today_topic['topic_pic']); ?>" alt="<?php echo $this->today_topic['topic_title']; ?>" />
                                    </a>
                                    <!-- end 话题图片 -->
                                </dt>
                                <dd class="pull-left">
                                    <?php echo $this->today_topic['topic_title']; ?>
                                </dd>
                            </dl>
                            <!-- 话题描述 -->
                            <p>
                                <span><?php echo nl2br($this->today_topic['topic_description']); ?></span>...<a href="topic/<?php echo $this->today_topic['url_token']; ?>"><?php _e('进入话题'); ?> »</a></p>
                            <!-- end 话题描述 -->
                        </div>
                    </div>
                    <!-- end 今日话题 -->
                    <!-- 新增话题 -->
                    <div class="aw-mod new-topic">
                        <div class="mod-head">
                            <h3><?php _e('新增话题'); ?></h3>
                        </div>
                        <div class="mod-body clearfix">
                            <div class="aw-topic-bar">
                                <div class="topic-bar clearfix">
                                    <?php foreach ($this->new_topics AS $key => $val) { ?>
                                    <span class="topic-tag">
                                        <a class="text" href="topic/<?php echo $val['url_token']; ?>" data-id="<?php echo $val['topic_id']; ?>"><?php echo $val['topic_title']; ?></a>
                                    </span>
                                    <?php } ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- end 新增话题 -->
                    <?php if ($this->user_id) { ?>
                    <div class="aw-mod">
                        <div class="mod-body">
                            <a href="home/#focus_topic__focus"><?php _e('我关注的话题'); ?></a>
                        </div>
                    </div>
                    <?php } ?>
                </div>
                <!-- end 侧边栏 -->
            </div>
        </div>
    </div>
</div>

<?php TPL::output('global/footer.tpl.htm'); ?>
